import java.util.Scanner;

/**
 * @Author YuanYuan
 * @Date 2022/4/27
 * @Time 11:17
 */
public class TestDemo {
    public static int fac(int n) {
        int sum = 1;
        for (int i = 1; i <= n; i++) {
            sum*=i;
        }
        return sum;
    }
    public static int addFac(int n) {
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            sum+=fac(i);
        }
        return sum;
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNextInt()) {
            int n = scanner.nextInt();
            System.out.println(n+"阶乘的和为："+ addFac(n));
        }
    }
}